<div id="register">
<div class="step">
<a href="{{url:site uri='users/register'}}">1. {{helper:lang line='users:register_step1'}}</a>
<span class="active">2. {{helper:lang line='users:register_step2'}}</span>
<!--<span>3. {{helper:lang line='users:register_step3'}}</span>-->
</div>


<?php 
$attributes = array('class' => 'form_inputs ', 'id' => '');
echo form_open_multipart('',$attributes)?>

<div class="fl">
	<table class="table">
<tbody>
	<tr>
		<td>
			<?php 
			$data = array('name'=>'username','id'=>'username','value'=> $model['username'],'maxlength'=>20,'class'=>'txt fl','placeholder'=>lang('users:username'));
			echo form_input($data); ?>
			<?php 
			$data = array('name'=>'password','id'=>'password','value'=> $model['password'],'maxlength'=>20,'class'=>'txt fr ','placeholder ' => lang('users:password'));
			echo form_password($data)?>
		</td>
    </tr>  
	<tr>
		<td>
			<?php 
			$data = array('name'=>'email','id'=>'email','value'=> $model['email'],'maxlength'=>60,'class'=>'txt fl','placeholder'=>'Email');
			echo form_input($data); ?>
			<div class="date_start-s">
			<input type="text" name="date_start" id="date_start" class="txt fr" value="<?php echo $model['date_start']?>" placeholder="<?php echo lang('users:date_start');?>" />
			</div>
		</td>
    </tr>
	<tr>
		<td>
			<input type="text" class="txt fl" disabled value="{{room:title}}" />
			<?php 
				$data = array('name'=>'location','id'=>'location','value'=> $model['location'],'maxlength'=>30,'class'=>'txt fr','placeholder'=>lang('users:location'));
				echo form_input($data); ?>
			
			<input type="hidden" name="room_id" value="{{room:id}}" />
			<input type="hidden" name="position_id" value="5" /><!--dang ky la nhan vien het, active se chon truong phong,giam doc..-->
		</td>
    </tr>
	<tr>
		<td class="birth-s">
			<?php 
			$data = array('name'=>'birth','id'=>'birth','value'=> $model['birth'],'maxlength'=>10,'class'=>'txt fl','placeholder'=>lang('users:birth'));
			echo form_input($data); ?>
			<?php 
				$data = array('name'=>'space','id'=>'space','value'=> $model['space'],'maxlength'=>30,'class'=>'txt fr','placeholder'=>lang('users:space'));
				echo form_input($data); ?>
		</td>
    </tr>
	<tr>
		<td>
			<?php 
			$data = array('name'=>'address','id'=>'address','value'=> $model['address'],'maxlength'=>100,'class'=>'txt large','placeholder'=>lang('users:address'));
			echo form_input($data); ?>
		</td>
	</tr>
	<tr>
		<td>
			<?php 
			$data = array('name'=>'address2','id'=>'address2','value'=> $model['address2'],'maxlength'=>100,'class'=>'txt large','placeholder'=>lang('users:address2'));
			echo form_input($data); ?>
		</td>
		</tr>
</tbody>
</table>
</div>
<!--.fl-->
<div class="fr">
	<table class="table">
	<tbody>
		<tr>
			<td>
				<?php 
				$data = array('name'=>'display_name','id'=>'display_name','value'=> $model['display_name'],'maxlength'=>30,'class'=>'txt large','placeholder'=>lang('users:full_name'));
				echo form_input($data); ?>
			</td>
		</tr>
		<tr>
			<td>
				<?php 
				echo form_dropdown('sex',array(''=>'---'.lang('users:sex').'---') +  $sex_select,$model['sex'],'class="fl"'); ?>
				<?php 
			$data = array('name'=>'people','id'=>'people','value'=> $model['people'],'maxlength'=>20,'class'=>'txt fr','placeholder'=>lang('users:people'));
			echo form_input($data); ?>
			</td>
		</tr>
		<tr>
			<td>
				<?php 
				$data = array('name'=>'id_number','id'=>'id_number','value'=> $model['id_number'],'maxlength'=>12,'class'=>'txt fl','placeholder'=>lang('users:id_number'));
				echo form_input($data); ?>
				<?php 
				$data = array('name'=>'phone','id'=>'phone','value'=> $model['phone'],'maxlength'=>15,'class'=>'txt fr','placeholder'=>lang('users:phone'));
				echo form_input($data); ?>
			</td>
		</tr>
		<tr>
			<td>
				<?php 
				echo form_dropdown('marry',array(''=>'---'.lang('users:marry').'---') +  $marry_select,$model['marry'],'class="fl"'); ?>
				<?php 
				echo form_dropdown('literacy',array(''=>'---'.lang('users:literacy').'---') + $literacy_select,$model['literacy'],'class="fr"'); ?>
			</td>
		</tr>
		
		<tr>
			<td>
				<?php 
				$data = array('name'=>'specialize','id'=>'specialize','value'=> $model['specialize'],'maxlength'=>30,'class'=>'txt fl','placeholder'=>lang('users:specialize'));
				echo form_input($data); ?>
				<?php 
				$data = array('name'=>'certificate','id'=>'certificate','value'=> $model['certificate'],'maxlength'=>100,'class'=>'txt fr','placeholder'=>lang('users:certificate'));
				echo form_input($data); ?>				
			</td>
		</tr>
		<tr>
		<td>
			<?php 
			$data = array('name'=>'bank_id','id'=>'bank_id','value'=> $model['bank_id'],'maxlength'=>15,'class'=>'txt large','placeholder'=>lang('users:bank_id'));
			echo form_input($data); ?>
		</td>
		</tr>
	</tbody>
	</table>
</div>

<div class="clr">
<button class="btn">{{helper:lang line='users:register'}}</button>
<input class="btn" type="reset" value="{{helper:lang line='users:reset'}}" />
</div>
<div class="clr15"></div>
<div class="clr">
<?php echo validation_errors('<p class="error">', '</p>'); ?>
</div>
<?php echo form_close()?>
</div>
<div class="shadow"></div>

<script>
$month_lang = '<?php echo lang('users:month') ?> ';
var mo = [];
for($i = 1;$i<13 ; $i++)
	mo.push($month_lang+$i);
var monthNamesShort = mo;
var dayNamesMin = [ '', '','','','','',''];
$("#birth").datepicker({
            changeMonth: true,
            changeYear: true,
            showButtonPanel: true,
			showOn: "button",
			buttonImage: "{{ url:site uri= theme:path}}/img/_icon/btn_calenda.jpg",
			buttonImageOnly: true,
			yearRange: '<?php echo date("Y") - 60 ?>:<?php echo date("Y")-10 ?>',
			monthNamesShort : monthNamesShort,
			
			dayNamesMin: dayNamesMin,
			
			dateFormat: "dd-mm-yy",
			nextText: "Sau",
			prevText: "Trước",
});
$("#date_start").datepicker({
            changeMonth: true,
            changeYear: true,
            showButtonPanel: true,
			showOn: "button",
			buttonImage: "{{ url:site uri= theme:path}}/img/_icon/btn_calenda.jpg",
			buttonImageOnly: true,
			yearRange: '<?php echo date("Y") - 60 ?>:<?php echo date("Y") ?>',
			monthNamesShort : monthNamesShort,
			
			dayNamesMin: dayNamesMin,
			
			dateFormat: "dd-mm-yy",
			nextText: "Sau",
			prevText: "Trước",
});


{{ if sussess}}
var r=confirm("{{helper:lang line='users:success_step2'}} {{room:title}} {{helper:lang line='users:ques_step2'}}");
if(r==true)
	$('.form_inputs input[type="text"]').val('');
else
	location.href = "users/login";
{{ endif }}
</script>